<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    //1.声明数组
    var arr=[1,2,3];
    //0 1 2
    //2.读取数组的值arr[i]；
    //arr.[i] 下标从0开始
    //3.获取数组的长度
    var len =arr.length;
    console.log(arr[1]);
    console.log(len);
    //4.向数组的尾部添加值
    arr[arr.length] = 4;
    console.log(arr);
    </script>
</body>
</html>